Object.extend(Prototype.BrowserFeatures, {
  _testBrowserSupport: function(mimeType, activeXClass) {
    var mimeTypes = navigator.mimeTypes; 
    if ((mimeTypes != null) && (mimeTypes.length > 0)) {
      if (mimeTypes[mimeType] != null) 
        return true; // Firefox
      else {
        // Opera, Chrome, Safari
        for (var i = 0; i < mimeTypes.length; i++) {
          if (mimeTypes[i].type == mimeType)
            return true;
        }
        
        return false;
      }
    }
    else {
      try {
        if (new ActiveXObject(activeXClass))
          return true;
      } catch (e) {
        return false;
      }
    }
  },
  supportsSVG: function() {
    /* TODO: Only Safari 3.0+ support SVG without plugin */
    if (Prototype.Browser.WebKit||Prototype.Browser.Gecko)
      return true;
    else
      return this._testBrowserSupport("image/svg-xml", "Adobe.SVGCtl");
  }
});